﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace IngredSubTool
{
    /// <summary>
    /// Interaction logic for MySubstitutionView.xaml
    /// </summary>
    public partial class MySubstitutionView : UserControl, IAppPage
    {
        public MySubstitutionView()
        {
            InitializeComponent();
            Menu.Content = new SideMenu();
            MySubGrid.ItemsSource = MainWindow.session.bookmarkSubs;
        }
        
        private void RatiosBtn_Click(object sender, RoutedEventArgs e)
        {
            Substitution subtemp = (Substitution)MySubGrid.CurrentItem;
            MainWindow.session.selectedSub = subtemp;
           // MainWindow.session.lastPage = new MySubstitutionView();
            //PageSwitcher.Switch(new ConversionCalcView());
            //MainWindow.session.addToPrevPageList(new BookmarkView());
            PageSwitcher.SwitchForward(new ConversionCalcView());
        }

     
             private void Back(object sender, RoutedEventArgs e)
        {
            //PageSwitcher.Switch(MainWindow.session.lastPage);
            PageSwitcher.SwitchBack();
           // MainWindow.session.removeFromPrevPageList();
        }
        
        
    }
}
